/**
 * @author:albert
 */

package com.bkbw.live.battle.business.skill.effect;

import java.util.HashMap;

import com.bkbw.live.battle.business.UnitObject;
import com.bkbw.live.battle.business.skill.EffectBase;

public class DamageEffect extends EffectBase {
	protected UnitObject source;
	protected UnitObject target;

	public DamageEffect(HashMap<String, Object> param) {
		super(param);
		source = (UnitObject)param.get("source");
		target = (UnitObject)param.get("target");
	}
	
	@Override
	public boolean applyEffect()
	{
		int damage = source.getFinalAttack();
		target.onHpChange(source, -damage);
		source.getMap().damageNotify(source.getId(), target.getId(), damage, target.getCurrentHp());
		return true;
	}

	
}
